#include "Window.h"

Window::Window(): QWidget(){
        setWindowIcon(QIcon("C:/Users/Simon' KHARRAZ/Desktop/icon.jpg"));
        this->resize(450,250);
        QFont font("Mainandra GD",14);

    // creation du tab Widget
    tab= new QTabWidget;
    // Declaration des pages
        admin= new Authentification;
        gClient= new Authentification;

    // Ajouter les pages au QTabWidget
        tab->addTab(admin,"Admin");
        tab->addTab(gClient, "Gestion client");

        QHBoxLayout* layout= new QHBoxLayout;
        layout->addWidget(tab);

        this->setLayout(layout);



    // Definition de style
        style= "QWidget{background-image: url(\"C:/Users/Simon' KHARRAZ/Desktop/png.png\")}";
        style+= "QLabel{color: #FFFFFF;}";
        style+= "QLineEdit{color: #FFFFFF;}";
        style+= "QPushButton{background: #bab5dd; color: white;}";
        this->setStyleSheet(style);

    // signals et slots

        QObject::connect(admin->getQuitter(), SIGNAL(clicked()), this,SLOT(close()));
        QObject::connect(admin->getOk(), SIGNAL(clicked()), admin, SLOT(authentifierAdmin()));

        QObject::connect(gClient->getQuitter(), SIGNAL(clicked()), this,SLOT(close()));
        QObject::connect(gClient->getOk(), SIGNAL(clicked()), gClient, SLOT(authentifierGestion()));


}
